structure DebugPrint = 
struct
  structure Asm = Assem
  structure TS = ToString
  val debug = true
  fun print_asm i = 
      let fun pr (Asm.Addr(r1, r2)) =
              let val r1' = TS.rtoString r1
                  val r2' = TS.rtoString r2
              in  "Addr "^r1'^", "^r2'^"; "
              end
            | pr (Asm.Directive(s)) = "Directive: "^s^"; "
            | pr (Asm.Label(s, a)) = "Label: "^s^"; "
            | pr (Asm.ExtraAsst(a)) = "ExtraAsst: ; "
            | pr (Asm.Section(sec)) = "Section" ^ TS.sectoString(sec)^"; "
            | pr _ = "WIP"
      in  if debug 
          then print (pr i)
          else ()
      end
end
